<?php
//No direct access
defined('_JEXEC') or die('Restricted access');
?>
<div id="ownservices">
 <div id="mainmenuownservice"><?php echo MenuHelper::nav(); ?></div>
	<div id="mainownservice">
	<h3><?php echo JText::_('OWNSERVICE_ACCOUNT_DETAIL'); ?></h3>
	<hr />
	<?php
		$dateformat  = OwnserviceHelper::getParams('date_format', '%d/%m/%Y');
		$row = $this->row;
	?>
	<div class="cSubmenu">
		<ul class="submenu">
			<li><a href="#" onclick="javascript: submitbutton('detail')"><?php echo JText::_('OWNSERVICE_PERSONAL_DETAIL'); ?></a></li>
			<li><a href="#" onclick="javascript: submitbutton('account')" class="active"><?php echo JText::_('OWNSERVICE_ACCOUNTS'); ?></a></li>
			<li><a href="#" onclick="javascript: submitbutton('transfer')"><?php echo JText::_('OWNSERVICE_TRANSFER_HISTORYS'); ?></a></li>
		</ul>
	</div>
	<form action="<?php echo JRoute::_('index.php?option=com_ownservice'); ?>" method="post" name="adminForm">
	<table class="admintable">
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_DATE'); ?></td>
			<td><?php echo JHTML::_('date', $row->created, $dateformat); ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_ACCOUNT_NAME'); ?></td>
			<td><?php echo $row->account_name; ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_ACCOUNT_NO'); ?></td>
			<td><?php echo OwnserviceHelper::accountFormat($row->account_no); ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_ACCOUNT_TYPE'); ?></td>
			<td>
				<?php 
				if($row->account_type == 'other')
				{
					echo $row->type_other; 	
				} else {
					echo OwnserviceHelper::getAccountType($row->account_type);
				} 
				?>
			</td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_BANK_NAME'); ?></td>
			<td>
				<?php if($row->bank_name=='other'): ?>
					<?php echo $row->bank_other; ?>
				<?php else: ?>
					<?php echo $row->bank_name; ?>
				<?php endif; ?>
			</td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_BRANCH_NAME'); ?></td>
			<td><?php echo $row->branch_name; ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_BRANCH_CITY'); ?></td>
			<td><?php echo $row->branch_city; ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_ADDRESS'); ?></td>
			<td><?php echo $row->address; ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_CITY'); ?></td>
			<td><?php echo $row->city; ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_STATE'); ?></td>
			<td><?php echo $row->state; ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_POSTCODE'); ?></td>
			<td><?php echo $row->postcode; ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_COUNTRY'); ?></td>
			<td><?php echo $row->country; ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_BIRTHDAY'); ?> </td>
			<td>
				<?php 
					if( $row->birthday != '0000-00-00'){
						echo JHTML::_('date', $row->birthday, $dateformat); 
					}	
				?>
			</td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_PHONE'); ?></td>
			<td><?php echo $row->phone_no; ?></td>
		</tr>
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_EMAIL'); ?></td>
			<td><?php echo $row->email; ?></td>
		</tr>
		<tr>
			<td colspan="2"><hr /></td>
		</tr>
		<tr>
			<td colspan="2" align="center">
			<input type="button" name="cancel" value="<?php echo JText::_('OWNSERVICE_BACK'); ?>" onClick="javascript: submitbutton('account')" />
			<?php if($this->access->canEdit):?><input type="submit" name="edit" value="<?php echo JText::_('OWNSERVICE_EDIT'); ?>" /><?php endif; ?>
			</td>
		</tr>
	</table>
	<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
	<input type="hidden" name="mid" value="<?php echo $this->member->id; ?>" />
	<input type="hidden" name="user_id" value="<?php echo $this->member->user_id; ?>" />
	<input type="hidden" name="option" value="com_ownservice" />
	<input type="hidden" name="task" value="acedit" />
	<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid'); ?>" />
	<input type="hidden" name="controller" value="member" />
	<input type="hidden" name="view" value="member" />
	<?php echo JHTML::_( 'form.token' ); ?>
	</form>
	</div>
</div>